import common from '../common'
import mod from '../mod'
import service from '../../utils/request'

const desk = {
    list() {
        return service.get(mod.desk + '/list').then(data => {
            return Promise.resolve(data)
        }).catch(err => {
            return Promise.reject(err)
        })
    },
    add(data) {
        return common.add(mod.desk, data)
    },
    edit(data) {
        return common.edit(mod.desk, data)
    },
    delete(data) {
        return service.put(mod.desk + '/delete', data).then(data => {
            return Promise.resolve(data)
        }).catch(err => {
            return Promise.reject(err)
        })
    },
    get(id) {
        return common.get(mod.desk, id)
    }
}

export default desk;